@extends('admin.layouts.base')
@section('title','产品表现数据')
@section('pageHeader','产品表现数据')

@section('content')
    <div class="row">

        <!-- Nav tabs -->
        <ul class="nav nav-tabs" role="tablist">
            <li role="presentation" class="active">
                <a href="{{ url('/admin/data/delivery/index')}}" aria-controls="tab1" role="tab">
                    昨日产品总览
                </a>
            </li>
            <li role="presentation">
                <a href="{{ url('/admin/data/delivery/index?tab=1')}}" aria-controls="tab2" role="tab">
                    30天产品总览
                </a>
            </li>
        </ul>


        {{--昨天产品总览 开始--}}
        <div class="col-xs-12">
            <div class="box">
                <div class="box-header">
                    {{--<h3 class="box-title pull-right">昨天产品总览</h3>--}}
                    <div class="pull-right">
                        <form action="">
                            选择日期: <input type="date" name="date" value="{{ $date ?: date('Y-m-d') }}"/>
                            <button>
                                <span class="button glyphicon glyphicon-search"></span>
                            </button>
                        </form>
                    </div>
                </div>

                <div class="box-footer" style="overflow: hidden">

                    <table id="records-table" class="table table-bordered table-striped">
                        <thead>
                        <tr>
                            <th>#</th>
                            <th>渠道名称</th>
                            {{--<th>详情点击PV</th>--}}
                            {{--<th>详情点击UV</th>--}}
                            <th>申请点击PV</th>
                            <th>申请点击UV</th>
                            <th>安稳申请点击UV</th>
                            <th>现金贷申请点击UV</th>

                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>

                        @foreach($data_list as $key => $data)
                            <tr>
                                <td>{{ $key + 1 }}</td>
                                <td>
                                    {{ $data['title'] }}
                                </td>
                                {{--<td>{{ $data['details_total'] }}</td>--}}
                                {{--<td>{{ $data['details_user_total'] }}</td>--}}
                                <td>{{ $data['apply_total'] }}</td>
                                <td>{{ $data['user_total'] }}</td>
                                <td>{{ $data['aw_total'] }}</td>
                                <td>{{ $data['xjd_total'] }}</td>

                                <td>
                                    <a href="{{ url('/admin/data/delivery/lists/today/' . $data['channel']) }}"
                                       class="btn btn-info btn-xs">信息详情</a>
                                </td>
                            </tr>
                        @endforeach

                        </tbody>
                    </table>

                    {{--导出Excel 开始--}}
                    <div class="pull-right">
                        <span style="display: inline-block;margin: 20px;">
                            <a href="{{ url('/delivery/data/excel?date=' . $date ?: date('Y-m-d')) }}">
                                <button type="button" class="btn btn-warning btn-xs">
                                    导出Excel
                                </button>
                            </a>
                        </span>
                    </div>
                    {{--导出Excel 结束--}}

                </div>
            </div>
        </div>
        {{--昨天产品总览 结束--}}

    </div>
@endsection
